//问卷中心公共类
layui.define(function (exports) {
    const paperCommon = {
        questionType: function (qutype) {
            if (qutype === 1) {
                return "单选题";
            } else if (qutype === 2) {
                return "多选题";
            } else if (qutype === 3) {
                return "主观题";
            } else {
                return "未知题型"
            }
        },
        // 获取当前时间 返回格式 yyyy-MM-dd HH:MM:SS
        getNowFormatDate:function () {
            let date = new Date();
            let seperator1 = "-";
            let seperator2 = ":";
            let year = date.getFullYear();//年
            let month = date.getMonth() + 1;//月
            let strDate = date.getDate();//日
            let hours = date.getHours();//时
            let minutes = date.getMinutes();//分
            let seconds = date.getSeconds();//秒
            if (month >= 1 && month <= 9) {
                month = "0" + month;
            }
            if (strDate >= 0 && strDate <= 9) {
                strDate = "0" + strDate;
            }
            if (hours >= 0 && hours <= 9) {
                hours = "0" + hours;
            }
            if (minutes >= 0 && minutes <= 9) {
                minutes = "0" + minutes;
            }
            if (seconds >= 0 && seconds <= 9) {
                seconds = "0" + seconds;
            }
            let currentDate;
            currentDate = year + seperator1 + month + seperator1 + strDate
                + " " + hours + seperator2 + minutes
                + seperator2 + seconds;
            return currentDate;
        }

    };

    exports('paperCommon', paperCommon);
});
